hico_object2label_index = {
    4: [0, 9],
    1: [10, 23],
    14: [24, 30],
    8: [31, 45],
    39: [46, 53],
    5: [54, 64],
    15: [65, 85],
    56: [86, 91],
    57: [92, 95],
    19: [96, 106],
    50: [107, 110],
    16: [111, 128],
    17: [129, 145],
    3: [146, 159],
    0: [160, 169],
    58: [170, 173],
    18: [174, 185],
    6: [186, 193],
    62: [194, 197],
    47: [198, 207],
    24: [208, 213],
    46: [214, 223],
    34: [224, 231],
    35: [232, 234],
    21: [235, 238],
    59: [239, 242],
    13: [243, 246],
    73: [247, 251],
    45: [252, 256],


}

hico_text_label = {(4, 4): 'a photo of a person boarding an airplane',
                   (17, 4): 'a photo of a person directing an airplane',
                   (25, 4): 'a photo of a person exiting an airplane',
                   (30, 4): 'a photo of a person flying an airplane',
                   (41, 4): 'a photo of a person inspecting an airplane',
                   (52, 4): 'a photo of a person loading an airplane',
                   (76, 4): 'a photo of a person riding an airplane',
                   (87, 4): 'a photo of a person sitting on an airplane',
                   (111, 4): 'a photo of a person washing an airplane',
                   (57, 4): 'a photo of a person and an airplane', (8, 1): 'a photo of a person carrying a bicycle',
                   (36, 1): 'a photo of a person holding a bicycle',
                   (41, 1): 'a photo of a person inspecting a bicycle',
                   (43, 1): 'a photo of a person jumping a bicycle',
                   (37, 1): 'a photo of a person hopping on a bicycle',
                   (62, 1): 'a photo of a person parking a bicycle',
                   (71, 1): 'a photo of a person pushing a bicycle',
                   (75, 1): 'a photo of a person repairing a bicycle',
                   (76, 1): 'a photo of a person riding a bicycle',
                   (87, 1): 'a photo of a person sitting on a bicycle',
                   (98, 1): 'a photo of a person straddling a bicycle',
                   (110, 1): 'a photo of a person walking a bicycle',
                   (111, 1): 'a photo of a person washing a bicycle', (57, 1): 'a photo of a person and a bicycle', # 23
                   (10, 14): 'a photo of a person chasing a bird', (26, 14): 'a photo of a person feeding a bird',
                   (36, 14): 'a photo of a person holding a bird', (65, 14): 'a photo of a person petting a bird',
                   (74, 14): 'a photo of a person releasing a bird',
                   (112, 14): 'a photo of a person watching a bird', (57, 14): 'a photo of a person and a bird', # 30
                   (4, 8): 'a photo of a person boarding a boat', (21, 8): 'a photo of a person driving a boat',
                   (25, 8): 'a photo of a person exiting a boat', (41, 8): 'a photo of a person inspecting a boat',
                   (43, 8): 'a photo of a person jumping a boat', (47, 8): 'a photo of a person launching a boat',
                   (75, 8): 'a photo of a person repairing a boat', (76, 8): 'a photo of a person riding a boat',
                   (77, 8): 'a photo of a person rowing a boat', (79, 8): 'a photo of a person sailing a boat',
                   (87, 8): 'a photo of a person sitting on a boat',
                   (93, 8): 'a photo of a person standing on a boat', (105, 8): 'a photo of a person tying a boat',
                   (111, 8): 'a photo of a person washing a boat', (57, 8): 'a photo of a person and a boat', # 45
                   (8, 39): 'a photo of a person carrying a bottle',
                   (20, 39): 'a photo of a person drinking with a bottle',
                   (36, 39): 'a photo of a person holding a bottle',
                   (41, 39): 'a photo of a person inspecting a bottle',
                   (48, 39): 'a photo of a person licking a bottle',
                   (58, 39): 'a photo of a person opening a bottle',
                   (69, 39): 'a photo of a person pouring a bottle', (57, 39): 'a photo of a person and a bottle', # 53
                   (4, 5): 'a photo of a person boarding a bus', (17, 5): 'a photo of a person directing a bus',
                   (21, 5): 'a photo of a person driving a bus', (25, 5): 'a photo of a person exiting a bus',
                   (41, 5): 'a photo of a person inspecting a bus', (52, 5): 'a photo of a person loading a bus',
                   (76, 5): 'a photo of a person riding a bus', (87, 5): 'a photo of a person sitting on a bus',
                   (111, 5): 'a photo of a person washing a bus', (113, 5): 'a photo of a person waving a bus',
                   (57, 5): 'a photo of a person and a bus', (4, 2): 'a photo of a person boarding a car',
                   (17, 2): 'a photo of a person directing a car', (21, 2): 'a photo of a person driving a car',
                   (38, 2): 'a photo of a person hosing a car', (41, 2): 'a photo of a person inspecting a car',
                   (43, 2): 'a photo of a person jumping a car', (52, 2): 'a photo of a person loading a car',
                   (62, 2): 'a photo of a person parking a car', (76, 2): 'a photo of a person riding a car',
                   (111, 2): 'a photo of a person washing a car', (57, 2): 'a photo of a person and a car',
                   (22, 15): 'a photo of a person drying a cat', (26, 15): 'a photo of a person feeding a cat',
                   (36, 15): 'a photo of a person holding a cat', (39, 15): 'a photo of a person hugging a cat',
                   (45, 15): 'a photo of a person kissing a cat', (65, 15): 'a photo of a person petting a cat',
                   (80, 15): 'a photo of a person scratching a cat', (111, 15): 'a photo of a person washing a cat',
                   (10, 15): 'a photo of a person chasing a cat', (57, 15): 'a photo of a person and a cat', # 85
                   (8, 56): 'a photo of a person carrying a chair', (36, 56): 'a photo of a person holding a chair',
                   (49, 56): 'a photo of a person lying on a chair',
                   (87, 56): 'a photo of a person sitting on a chair',
                   (93, 56): 'a photo of a person standing on a chair', (57, 56): 'a photo of a person and a chair', # 91
                   (8, 57): 'a photo of a person carrying a couch',
                   (49, 57): 'a photo of a person lying on a couch',
                   (87, 57): 'a photo of a person sitting on a couch', (57, 57): 'a photo of a person and a couch', # 95
                   (26, 19): 'a photo of a person feeding a cow', (34, 19): 'a photo of a person herding a cow',
                   (36, 19): 'a photo of a person holding a cow', (39, 19): 'a photo of a person hugging a cow',
                   (45, 19): 'a photo of a person kissing a cow', (46, 19): 'a photo of a person lassoing a cow',
                   (55, 19): 'a photo of a person milking a cow', (65, 19): 'a photo of a person petting a cow',
                   (76, 19): 'a photo of a person riding a cow', (110, 19): 'a photo of a person walking a cow',
                   (57, 19): 'a photo of a person and a cow', # 106
                   (12, 60): 'a photo of a person cleaning a dining table',
                   (24, 60): 'a photo of a person eating at a dining table',
                   (86, 60): 'a photo of a person sitting at a dining table',
                   (57, 60): 'a photo of a person and a dining table', # 110
                   (8, 16): 'a photo of a person carrying a dog', (22, 16): 'a photo of a person drying a dog',
                   (26, 16): 'a photo of a person feeding a dog', (33, 16): 'a photo of a person grooming a dog',
                   (36, 16): 'a photo of a person holding a dog', (38, 16): 'a photo of a person hosing a dog',
                   (39, 16): 'a photo of a person hugging a dog', (41, 16): 'a photo of a person inspecting a dog',
                   (45, 16): 'a photo of a person kissing a dog', (65, 16): 'a photo of a person petting a dog',
                   (78, 16): 'a photo of a person running a dog', (80, 16): 'a photo of a person scratching a dog',
                   (98, 16): 'a photo of a person straddling a dog',
                   (107, 16): 'a photo of a person training a dog', (110, 16): 'a photo of a person walking a dog',
                   (111, 16): 'a photo of a person washing a dog', (10, 16): 'a photo of a person chasing a dog',
                   (57, 16): 'a photo of a person and a dog', (26, 17): 'a photo of a person feeding a horse',
                   (33, 17): 'a photo of a person grooming a horse',
                   (36, 17): 'a photo of a person holding a horse', (39, 17): 'a photo of a person hugging a horse',
                   (43, 17): 'a photo of a person jumping a horse', (45, 17): 'a photo of a person kissing a horse',
                   (52, 17): 'a photo of a person loading a horse',
                   (37, 17): 'a photo of a person hopping on a horse',
                   (65, 17): 'a photo of a person petting a horse', (72, 17): 'a photo of a person racing a horse',
                   (76, 17): 'a photo of a person riding a horse', (78, 17): 'a photo of a person running a horse',
                   (98, 17): 'a photo of a person straddling a horse',
                   (107, 17): 'a photo of a person training a horse',
                   (110, 17): 'a photo of a person walking a horse',
                   (111, 17): 'a photo of a person washing a horse', (57, 17): 'a photo of a person and a horse', # 145
                   (36, 3): 'a photo of a person holding a motorcycle',
                   (41, 3): 'a photo of a person inspecting a motorcycle',
                   (43, 3): 'a photo of a person jumping a motorcycle',
                   (37, 3): 'a photo of a person hopping on a motorcycle',
                   (62, 3): 'a photo of a person parking a motorcycle',
                   (71, 3): 'a photo of a person pushing a motorcycle',
                   (72, 3): 'a photo of a person racing a motorcycle',
                   (76, 3): 'a photo of a person riding a motorcycle',
                   (87, 3): 'a photo of a person sitting on a motorcycle',
                   (98, 3): 'a photo of a person straddling a motorcycle',
                   (108, 3): 'a photo of a person turning a motorcycle',
                   (110, 3): 'a photo of a person walking a motorcycle',
                   (111, 3): 'a photo of a person washing a motorcycle',
                   (57, 3): 'a photo of a person and a motorcycle', (8, 0): 'a photo of a person carrying a person',
                   (31, 0): 'a photo of a person greeting a person',
                   (36, 0): 'a photo of a person holding a person', (39, 0): 'a photo of a person hugging a person',
                   (45, 0): 'a photo of a person kissing a person',
                   (92, 0): 'a photo of a person stabbing a person',
                   (100, 0): 'a photo of a person tagging a person',
                   (102, 0): 'a photo of a person teaching a person',
                   (48, 0): 'a photo of a person licking a person', (57, 0): 'a photo of a person and a person', # 169
                   (8, 58): 'a photo of a person carrying a potted plant',
                   (36, 58): 'a photo of a person holding a potted plant',
                   (38, 58): 'a photo of a person hosing a potted plant',
                   (57, 58): 'a photo of a person and a potted plant', # 173
                   (8, 18): 'a photo of a person carrying a sheep', (26, 18): 'a photo of a person feeding a sheep',
                   (34, 18): 'a photo of a person herding a sheep', (36, 18): 'a photo of a person holding a sheep',
                   (39, 18): 'a photo of a person hugging a sheep', (45, 18): 'a photo of a person kissing a sheep',
                   (65, 18): 'a photo of a person petting a sheep', (76, 18): 'a photo of a person riding a sheep',
                   (83, 18): 'a photo of a person shearing a sheep',
                   (110, 18): 'a photo of a person walking a sheep',
                   (111, 18): 'a photo of a person washing a sheep', (57, 18): 'a photo of a person and a sheep', # 185
                   (4, 6): 'a photo of a person boarding a train', (21, 6): 'a photo of a person driving a train',
                   (25, 6): 'a photo of a person exiting a train', (52, 6): 'a photo of a person loading a train',
                   (76, 6): 'a photo of a person riding a train', (87, 6): 'a photo of a person sitting on a train',
                   (111, 6): 'a photo of a person washing a train', (57, 6): 'a photo of a person and a train', # 193
                   (13, 62): 'a photo of a person controlling a tv', (75, 62): 'a photo of a person repairing a tv',
                   (112, 62): 'a photo of a person watching a tv', (57, 62): 'a photo of a person and a tv', # 197
                   (7, 47): 'a photo of a person buying an apple', (15, 47): 'a photo of a person cutting an apple',
                   (23, 47): 'a photo of a person eating an apple',
                   (36, 47): 'a photo of a person holding an apple',
                   (41, 47): 'a photo of a person inspecting an apple',
                   (64, 47): 'a photo of a person peeling an apple',
                   (66, 47): 'a photo of a person picking an apple',
                   (89, 47): 'a photo of a person smelling an apple',
                   (111, 47): 'a photo of a person washing an apple', (57, 47): 'a photo of a person and an apple', # 207
                   (8, 24): 'a photo of a person carrying a backpack',
                   (36, 24): 'a photo of a person holding a backpack',
                   (41, 24): 'a photo of a person inspecting a backpack',
                   (58, 24): 'a photo of a person opening a backpack',
                   (114, 24): 'a photo of a person wearing a backpack',
                   (57, 24): 'a photo of a person and a backpack', (7, 46): 'a photo of a person buying a banana',
                   (8, 46): 'a photo of a person carrying a banana',
                   (15, 46): 'a photo of a person cutting a banana',
                   (23, 46): 'a photo of a person eating a banana',
                   (36, 46): 'a photo of a person holding a banana',
                   (41, 46): 'a photo of a person inspecting a banana',
                   (64, 46): 'a photo of a person peeling a banana',
                   (66, 46): 'a photo of a person picking a banana',
                   (89, 46): 'a photo of a person smelling a banana', (57, 46): 'a photo of a person and a banana', # 223
                   (5, 34): 'a photo of a person breaking a baseball bat',
                   (8, 34): 'a photo of a person carrying a baseball bat',
                   (36, 34): 'a photo of a person holding a baseball bat',
                   (84, 34): 'a photo of a person signing a baseball bat',
                   (99, 34): 'a photo of a person swinging a baseball bat',
                   (104, 34): 'a photo of a person throwing a baseball bat',
                   (115, 34): 'a photo of a person wielding a baseball bat',
                   (57, 34): 'a photo of a person and a baseball bat', # 231
                   (36, 35): 'a photo of a person holding a baseball glove',
                   (114, 35): 'a photo of a person wearing a baseball glove',
                   (57, 35): 'a photo of a person and a baseball glove', # 234
                   (26, 21): 'a photo of a person feeding a bear', (40, 21): 'a photo of a person hunting a bear',
                   (112, 21): 'a photo of a person watching a bear', (57, 21): 'a photo of a person and a bear', # 238
                   (12, 59): 'a photo of a person cleaning a bed', (49, 59): 'a photo of a person lying on a bed',
                   (87, 59): 'a photo of a person sitting on a bed', (57, 59): 'a photo of a person and a bed', # 242
                   (41, 13): 'a photo of a person inspecting a bench',
                   (49, 13): 'a photo of a person lying on a bench',
                   (87, 13): 'a photo of a person sitting on a bench', (57, 13): 'a photo of a person and a bench', # 246
                   (8, 73): 'a photo of a person carrying a book', (36, 73): 'a photo of a person holding a book',
                   (58, 73): 'a photo of a person opening a book', (73, 73): 'a photo of a person reading a book',
                   (57, 73): 'a photo of a person and a book', (36, 45): 'a photo of a person holding a bowl',
                   (96, 45): 'a photo of a person stirring a bowl', (111, 45): 'a photo of a person washing a bowl',
                   (48, 45): 'a photo of a person licking a bowl', (57, 45): 'a photo of a person and a bowl', # 256
                   (15, 50): 'a photo of a person cutting a broccoli',
                   (23, 50): 'a photo of a person eating a broccoli',
                   (36, 50): 'a photo of a person holding a broccoli',
                   (89, 50): 'a photo of a person smelling a broccoli',
                   (96, 50): 'a photo of a person stirring a broccoli',
                   (111, 50): 'a photo of a person washing a broccoli',
                   (57, 50): 'a photo of a person and a broccoli', (3, 55): 'a photo of a person blowing a cake',
                   (8, 55): 'a photo of a person carrying a cake', (15, 55): 'a photo of a person cutting a cake',
                   (23, 55): 'a photo of a person eating a cake', (36, 55): 'a photo of a person holding a cake',
                   (51, 55): 'a photo of a person lighting a cake', (54, 55): 'a photo of a person making a cake',
                   (67, 55): 'a photo of a person picking up a cake', (57, 55): 'a photo of a person and a cake',
                   (8, 51): 'a photo of a person carrying a carrot',
                   (14, 51): 'a photo of a person cooking a carrot',
                   (15, 51): 'a photo of a person cutting a carrot',
                   (23, 51): 'a photo of a person eating a carrot',
                   (36, 51): 'a photo of a person holding a carrot',
                   (64, 51): 'a photo of a person peeling a carrot',
                   (89, 51): 'a photo of a person smelling a carrot',
                   (96, 51): 'a photo of a person stirring a carrot',
                   (111, 51): 'a photo of a person washing a carrot', (57, 51): 'a photo of a person and a carrot',
                   (8, 67): 'a photo of a person carrying a cell phone',
                   (36, 67): 'a photo of a person holding a cell phone',
                   (73, 67): 'a photo of a person reading a cell phone',
                   (75, 67): 'a photo of a person repairing a cell phone',
                   (101, 67): 'a photo of a person talking on a cell phone',
                   (103, 67): 'a photo of a person texting on a cell phone',
                   (57, 67): 'a photo of a person and a cell phone',
                   (11, 74): 'a photo of a person checking a clock',
                   (36, 74): 'a photo of a person holding a clock',
                   (75, 74): 'a photo of a person repairing a clock',
                   (82, 74): 'a photo of a person setting a clock', (57, 74): 'a photo of a person and a clock',
                   (8, 41): 'a photo of a person carrying a cup',
                   (20, 41): 'a photo of a person drinking with a cup',
                   (36, 41): 'a photo of a person holding a cup', (41, 41): 'a photo of a person inspecting a cup',
                   (69, 41): 'a photo of a person pouring a cup', (85, 41): 'a photo of a person sipping a cup',
                   (89, 41): 'a photo of a person smelling a cup', (27, 41): 'a photo of a person filling a cup',
                   (111, 41): 'a photo of a person washing a cup', (57, 41): 'a photo of a person and a cup',
                   (7, 54): 'a photo of a person buying a donut', (8, 54): 'a photo of a person carrying a donut',
                   (23, 54): 'a photo of a person eating a donut', (36, 54): 'a photo of a person holding a donut',
                   (54, 54): 'a photo of a person making a donut',
                   (67, 54): 'a photo of a person picking up a donut',
                   (89, 54): 'a photo of a person smelling a donut', (57, 54): 'a photo of a person and a donut',
                   (26, 20): 'a photo of a person feeding an elephant',
                   (36, 20): 'a photo of a person holding an elephant',
                   (38, 20): 'a photo of a person hosing an elephant',
                   (39, 20): 'a photo of a person hugging an elephant',
                   (45, 20): 'a photo of a person kissing an elephant',
                   (37, 20): 'a photo of a person hopping on an elephant',
                   (65, 20): 'a photo of a person petting an elephant',
                   (76, 20): 'a photo of a person riding an elephant',
                   (110, 20): 'a photo of a person walking an elephant',
                   (111, 20): 'a photo of a person washing an elephant',
                   (112, 20): 'a photo of a person watching an elephant',
                   (57, 20): 'a photo of a person and an elephant',
                   (39, 10): 'a photo of a person hugging a fire hydrant',
                   (41, 10): 'a photo of a person inspecting a fire hydrant',
                   (58, 10): 'a photo of a person opening a fire hydrant',
                   (61, 10): 'a photo of a person painting a fire hydrant',
                   (57, 10): 'a photo of a person and a fire hydrant',
                   (36, 42): 'a photo of a person holding a fork', (50, 42): 'a photo of a person lifting a fork',
                   (95, 42): 'a photo of a person sticking a fork', (48, 42): 'a photo of a person licking a fork',
                   (111, 42): 'a photo of a person washing a fork', (57, 42): 'a photo of a person and a fork',
                   (2, 29): 'a photo of a person blocking a frisbee',
                   (9, 29): 'a photo of a person catching a frisbee',
                   (36, 29): 'a photo of a person holding a frisbee',
                   (90, 29): 'a photo of a person spinning a frisbee',
                   (104, 29): 'a photo of a person throwing a frisbee',
                   (57, 29): 'a photo of a person and a frisbee', (26, 23): 'a photo of a person feeding a giraffe',
                   (45, 23): 'a photo of a person kissing a giraffe',
                   (65, 23): 'a photo of a person petting a giraffe',
                   (76, 23): 'a photo of a person riding a giraffe',
                   (112, 23): 'a photo of a person watching a giraffe',
                   (57, 23): 'a photo of a person and a giraffe',
                   (36, 78): 'a photo of a person holding a hair drier',
                   (59, 78): 'a photo of a person operating a hair drier',
                   (75, 78): 'a photo of a person repairing a hair drier',
                   (57, 78): 'a photo of a person and a hair drier',
                   (8, 26): 'a photo of a person carrying a handbag',
                   (36, 26): 'a photo of a person holding a handbag',
                   (41, 26): 'a photo of a person inspecting a handbag',
                   (57, 26): 'a photo of a person and a handbag', (8, 52): 'a photo of a person carrying a hot dog',
                   (14, 52): 'a photo of a person cooking a hot dog',
                   (15, 52): 'a photo of a person cutting a hot dog',
                   (23, 52): 'a photo of a person eating a hot dog',
                   (36, 52): 'a photo of a person holding a hot dog',
                   (54, 52): 'a photo of a person making a hot dog', (57, 52): 'a photo of a person and a hot dog',
                   (8, 66): 'a photo of a person carrying a keyboard',
                   (12, 66): 'a photo of a person cleaning a keyboard',
                   (36, 66): 'a photo of a person holding a keyboard',
                   (109, 66): 'a photo of a person typing on a keyboard',
                   (57, 66): 'a photo of a person and a keyboard', (1, 33): 'a photo of a person assembling a kite',
                   (8, 33): 'a photo of a person carrying a kite', (30, 33): 'a photo of a person flying a kite',
                   (36, 33): 'a photo of a person holding a kite',
                   (41, 33): 'a photo of a person inspecting a kite',
                   (47, 33): 'a photo of a person launching a kite', (70, 33): 'a photo of a person pulling a kite',
                   (57, 33): 'a photo of a person and a kite', (16, 43): 'a photo of a person cutting with a knife',
                   (36, 43): 'a photo of a person holding a knife',
                   (95, 43): 'a photo of a person sticking a knife',
                   (111, 43): 'a photo of a person washing a knife',
                   (115, 43): 'a photo of a person wielding a knife',
                   (48, 43): 'a photo of a person licking a knife', (57, 43): 'a photo of a person and a knife',
                   (36, 63): 'a photo of a person holding a laptop',
                   (58, 63): 'a photo of a person opening a laptop',
                   (73, 63): 'a photo of a person reading a laptop',
                   (75, 63): 'a photo of a person repairing a laptop',
                   (109, 63): 'a photo of a person typing on a laptop',
                   (57, 63): 'a photo of a person and a laptop',
                   (12, 68): 'a photo of a person cleaning a microwave',
                   (58, 68): 'a photo of a person opening a microwave',
                   (59, 68): 'a photo of a person operating a microwave',
                   (57, 68): 'a photo of a person and a microwave',
                   (13, 64): 'a photo of a person controlling a mouse',
                   (36, 64): 'a photo of a person holding a mouse',
                   (75, 64): 'a photo of a person repairing a mouse', (57, 64): 'a photo of a person and a mouse',
                   (7, 49): 'a photo of a person buying an orange',
                   (15, 49): 'a photo of a person cutting an orange',
                   (23, 49): 'a photo of a person eating an orange',
                   (36, 49): 'a photo of a person holding an orange',
                   (41, 49): 'a photo of a person inspecting an orange',
                   (64, 49): 'a photo of a person peeling an orange',
                   (66, 49): 'a photo of a person picking an orange',
                   (91, 49): 'a photo of a person squeezing an orange',
                   (111, 49): 'a photo of a person washing an orange',
                   (57, 49): 'a photo of a person and an orange', (12, 69): 'a photo of a person cleaning an oven',
                   (36, 69): 'a photo of a person holding an oven',
                   (41, 69): 'a photo of a person inspecting an oven',
                   (58, 69): 'a photo of a person opening an oven',
                   (75, 69): 'a photo of a person repairing an oven',
                   (59, 69): 'a photo of a person operating an oven', (57, 69): 'a photo of a person and an oven',
                   (11, 12): 'a photo of a person checking a parking meter',
                   (63, 12): 'a photo of a person paying a parking meter',
                   (75, 12): 'a photo of a person repairing a parking meter',
                   (57, 12): 'a photo of a person and a parking meter',
                   (7, 53): 'a photo of a person buying a pizza', (8, 53): 'a photo of a person carrying a pizza',
                   (14, 53): 'a photo of a person cooking a pizza', (15, 53): 'a photo of a person cutting a pizza',
                   (23, 53): 'a photo of a person eating a pizza', (36, 53): 'a photo of a person holding a pizza',
                   (54, 53): 'a photo of a person making a pizza',
                   (67, 53): 'a photo of a person picking up a pizza',
                   (88, 53): 'a photo of a person sliding a pizza',
                   (89, 53): 'a photo of a person smelling a pizza', (57, 53): 'a photo of a person and a pizza',
                   (12, 72): 'a photo of a person cleaning a refrigerator',
                   (36, 72): 'a photo of a person holding a refrigerator',
                   (56, 72): 'a photo of a person moving a refrigerator',
                   (58, 72): 'a photo of a person opening a refrigerator',
                   (57, 72): 'a photo of a person and a refrigerator',
                   (36, 65): 'a photo of a person holding a remote',
                   (68, 65): 'a photo of a person pointing a remote',
                   (99, 65): 'a photo of a person swinging a remote', (57, 65): 'a photo of a person and a remote',
                   (8, 48): 'a photo of a person carrying a sandwich',
                   (14, 48): 'a photo of a person cooking a sandwich',
                   (15, 48): 'a photo of a person cutting a sandwich',
                   (23, 48): 'a photo of a person eating a sandwich',
                   (36, 48): 'a photo of a person holding a sandwich',
                   (54, 48): 'a photo of a person making a sandwich',
                   (57, 48): 'a photo of a person and a sandwich',
                   (16, 76): 'a photo of a person cutting with a scissors',
                   (36, 76): 'a photo of a person holding a scissors',
                   (58, 76): 'a photo of a person opening a scissors',
                   (57, 76): 'a photo of a person and a scissors', (12, 71): 'a photo of a person cleaning a sink',
                   (75, 71): 'a photo of a person repairing a sink',
                   (111, 71): 'a photo of a person washing a sink', (57, 71): 'a photo of a person and a sink',
                   (8, 36): 'a photo of a person carrying a skateboard',
                   (28, 36): 'a photo of a person flipping a skateboard',
                   (32, 36): 'a photo of a person grinding a skateboard',
                   (36, 36): 'a photo of a person holding a skateboard',
                   (43, 36): 'a photo of a person jumping a skateboard',
                   (67, 36): 'a photo of a person picking up a skateboard',
                   (76, 36): 'a photo of a person riding a skateboard',
                   (87, 36): 'a photo of a person sitting on a skateboard',
                   (93, 36): 'a photo of a person standing on a skateboard',
                   (57, 36): 'a photo of a person and a skateboard',
                   (0, 30): 'a photo of a person adjusting a skis', (8, 30): 'a photo of a person carrying a skis',
                   (36, 30): 'a photo of a person holding a skis',
                   (41, 30): 'a photo of a person inspecting a skis',
                   (43, 30): 'a photo of a person jumping a skis',
                   (67, 30): 'a photo of a person picking up a skis',
                   (75, 30): 'a photo of a person repairing a skis', (76, 30): 'a photo of a person riding a skis',
                   (93, 30): 'a photo of a person standing on a skis',
                   (114, 30): 'a photo of a person wearing a skis', (57, 30): 'a photo of a person and a skis',
                   (0, 31): 'a photo of a person adjusting a snowboard',
                   (8, 31): 'a photo of a person carrying a snowboard',
                   (32, 31): 'a photo of a person grinding a snowboard',
                   (36, 31): 'a photo of a person holding a snowboard',
                   (43, 31): 'a photo of a person jumping a snowboard',
                   (76, 31): 'a photo of a person riding a snowboard',
                   (93, 31): 'a photo of a person standing on a snowboard',
                   (114, 31): 'a photo of a person wearing a snowboard',
                   (57, 31): 'a photo of a person and a snowboard', (36, 44): 'a photo of a person holding a spoon',
                   (48, 44): 'a photo of a person licking a spoon',
                   (111, 44): 'a photo of a person washing a spoon',
                   (85, 44): 'a photo of a person sipping a spoon', (57, 44): 'a photo of a person and a spoon',
                   (2, 32): 'a photo of a person blocking a sports ball',
                   (8, 32): 'a photo of a person carrying a sports ball',
                   (9, 32): 'a photo of a person catching a sports ball',
                   (19, 32): 'a photo of a person dribbling a sports ball',
                   (35, 32): 'a photo of a person hitting a sports ball',
                   (36, 32): 'a photo of a person holding a sports ball',
                   (41, 32): 'a photo of a person inspecting a sports ball',
                   (44, 32): 'a photo of a person kicking a sports ball',
                   (67, 32): 'a photo of a person picking up a sports ball',
                   (81, 32): 'a photo of a person serving a sports ball',
                   (84, 32): 'a photo of a person signing a sports ball',
                   (90, 32): 'a photo of a person spinning a sports ball',
                   (104, 32): 'a photo of a person throwing a sports ball',
                   (57, 32): 'a photo of a person and a sports ball',
                   (36, 11): 'a photo of a person holding a stop sign',
                   (94, 11): 'a photo of a person standing under a stop sign',
                   (97, 11): 'a photo of a person stopping at a stop sign',
                   (57, 11): 'a photo of a person and a stop sign',
                   (8, 28): 'a photo of a person carrying a suitcase',
                   (18, 28): 'a photo of a person dragging a suitcase',
                   (36, 28): 'a photo of a person holding a suitcase',
                   (39, 28): 'a photo of a person hugging a suitcase',
                   (52, 28): 'a photo of a person loading a suitcase',
                   (58, 28): 'a photo of a person opening a suitcase',
                   (60, 28): 'a photo of a person packing a suitcase',
                   (67, 28): 'a photo of a person picking up a suitcase',
                   (116, 28): 'a photo of a person zipping a suitcase',
                   (57, 28): 'a photo of a person and a suitcase',
                   (8, 37): 'a photo of a person carrying a surfboard',
                   (18, 37): 'a photo of a person dragging a surfboard',
                   (36, 37): 'a photo of a person holding a surfboard',
                   (41, 37): 'a photo of a person inspecting a surfboard',
                   (43, 37): 'a photo of a person jumping a surfboard',
                   (49, 37): 'a photo of a person lying on a surfboard',
                   (52, 37): 'a photo of a person loading a surfboard',
                   (76, 37): 'a photo of a person riding a surfboard',
                   (93, 37): 'a photo of a person standing on a surfboard',
                   (87, 37): 'a photo of a person sitting on a surfboard',
                   (111, 37): 'a photo of a person washing a surfboard',
                   (57, 37): 'a photo of a person and a surfboard',
                   (8, 77): 'a photo of a person carrying a teddy bear',
                   (36, 77): 'a photo of a person holding a teddy bear',
                   (39, 77): 'a photo of a person hugging a teddy bear',
                   (45, 77): 'a photo of a person kissing a teddy bear',
                   (57, 77): 'a photo of a person and a teddy bear',
                   (8, 38): 'a photo of a person carrying a tennis racket',
                   (36, 38): 'a photo of a person holding a tennis racket',
                   (41, 38): 'a photo of a person inspecting a tennis racket',
                   (99, 38): 'a photo of a person swinging a tennis racket',
                   (57, 38): 'a photo of a person and a tennis racket',
                   (0, 27): 'a photo of a person adjusting a tie', (15, 27): 'a photo of a person cutting a tie',
                   (36, 27): 'a photo of a person holding a tie', (41, 27): 'a photo of a person inspecting a tie',
                   (70, 27): 'a photo of a person pulling a tie', (105, 27): 'a photo of a person tying a tie',
                   (114, 27): 'a photo of a person wearing a tie', (57, 27): 'a photo of a person and a tie',
                   (36, 70): 'a photo of a person holding a toaster',
                   (59, 70): 'a photo of a person operating a toaster',
                   (75, 70): 'a photo of a person repairing a toaster',
                   (57, 70): 'a photo of a person and a toaster', (12, 61): 'a photo of a person cleaning a toilet',
                   (29, 61): 'a photo of a person flushing a toilet',
                   (58, 61): 'a photo of a person opening a toilet',
                   (75, 61): 'a photo of a person repairing a toilet',
                   (87, 61): 'a photo of a person sitting on a toilet',
                   (93, 61): 'a photo of a person standing on a toilet',
                   (111, 61): 'a photo of a person washing a toilet', (57, 61): 'a photo of a person and a toilet',
                   (6, 79): 'a photo of a person brushing with a toothbrush',
                   (36, 79): 'a photo of a person holding a toothbrush',
                   (111, 79): 'a photo of a person washing a toothbrush',
                   (57, 79): 'a photo of a person and a toothbrush',
                   (42, 9): 'a photo of a person installing a traffic light',
                   (75, 9): 'a photo of a person repairing a traffic light',
                   (94, 9): 'a photo of a person standing under a traffic light',
                   (97, 9): 'a photo of a person stopping at a traffic light',
                   (57, 9): 'a photo of a person and a traffic light',
                   (17, 7): 'a photo of a person directing a truck', (21, 7): 'a photo of a person driving a truck',
                   (41, 7): 'a photo of a person inspecting a truck',
                   (52, 7): 'a photo of a person loading a truck', (75, 7): 'a photo of a person repairing a truck',
                   (76, 7): 'a photo of a person riding a truck', (87, 7): 'a photo of a person sitting on a truck',
                   (111, 7): 'a photo of a person washing a truck', (57, 7): 'a photo of a person and a truck',
                   (8, 25): 'a photo of a person carrying a umbrella',
                   (36, 25): 'a photo of a person holding a umbrella',
                   (53, 25): 'a photo of a person losing a umbrella',
                   (58, 25): 'a photo of a person opening a umbrella',
                   (75, 25): 'a photo of a person repairing a umbrella',
                   (82, 25): 'a photo of a person setting a umbrella',
                   (94, 25): 'a photo of a person standing under a umbrella',
                   (57, 25): 'a photo of a person and a umbrella', (36, 75): 'a photo of a person holding a vase',
                   (54, 75): 'a photo of a person making a vase', (61, 75): 'a photo of a person painting a vase',
                   (57, 75): 'a photo of a person and a vase', (27, 40): 'a photo of a person filling a wine glass',
                   (36, 40): 'a photo of a person holding a wine glass',
                   (85, 40): 'a photo of a person sipping a wine glass',
                   (106, 40): 'a photo of a person toasting a wine glass',
                   (48, 40): 'a photo of a person licking a wine glass',
                   (111, 40): 'a photo of a person washing a wine glass',
                   (57, 40): 'a photo of a person and a wine glass',
                   (26, 22): 'a photo of a person feeding a zebra', (36, 22): 'a photo of a person holding a zebra',
                   (65, 22): 'a photo of a person petting a zebra',
                   (112, 22): 'a photo of a person watching a zebra', (57, 22): 'a photo of a person and a zebra'}
hico_text_label
a = 4
count_start = 0
count_end = 0
hico_object2label_index = {}
print(len(hico_text_label.keys()))
for id in hico_text_label.keys():
    if a == id[1]:
        count_end += 1
        continue
    else:
        hico_object2label_index[a] = [count_start, count_end - 1]
        a = id[1]
        count_start = count_end
        count_end += 1
print(count_end)
hico_object2label_index[a] = [count_start, count_end - 1]

# hico_object2label_index[a] = [count_start, count_end]
print(hico_object2label_index)
hico_obj_text_label = [(0, 'a photo of a person'), (1, 'a photo of a bicycle'), (2, 'a photo of a car'),
                       (3, 'a photo of a motorcycle'), (4, 'a photo of an airplane'), (5, 'a photo of a bus'),
                       (6, 'a photo of a train'), (7, 'a photo of a truck'), (8, 'a photo of a boat'),
                       (9, 'a photo of a traffic light'), (10, 'a photo of a fire hydrant'),
                       (11, 'a photo of a stop sign'), (12, 'a photo of a parking meter'), (13, 'a photo of a bench'),
                       (14, 'a photo of a bird'), (15, 'a photo of a cat'), (16, 'a photo of a dog'),
                       (17, 'a photo of a horse'), (18, 'a photo of a sheep'), (19, 'a photo of a cow'),
                       (20, 'a photo of an elephant'), (21, 'a photo of a bear'), (22, 'a photo of a zebra'),
                       (23, 'a photo of a giraffe'), (24, 'a photo of a backpack'), (25, 'a photo of a umbrella'),
                       (26, 'a photo of a handbag'), (27, 'a photo of a tie'), (28, 'a photo of a suitcase'),
                       (29, 'a photo of a frisbee'), (30, 'a photo of a skis'), (31, 'a photo of a snowboard'),
                       (32, 'a photo of a sports ball'), (33, 'a photo of a kite'), (34, 'a photo of a baseball bat'),
                       (35, 'a photo of a baseball glove'), (36, 'a photo of a skateboard'),
                       (37, 'a photo of a surfboard'), (38, 'a photo of a tennis racket'), (39, 'a photo of a bottle'),
                       (40, 'a photo of a wine glass'), (41, 'a photo of a cup'), (42, 'a photo of a fork'),
                       (43, 'a photo of a knife'), (44, 'a photo of a spoon'), (45, 'a photo of a bowl'),
                       (46, 'a photo of a banana'), (47, 'a photo of an apple'), (48, 'a photo of a sandwich'),
                       (49, 'a photo of an orange'), (50, 'a photo of a broccoli'), (51, 'a photo of a carrot'),
                       (52, 'a photo of a hot dog'), (53, 'a photo of a pizza'), (54, 'a photo of a donut'),
                       (55, 'a photo of a cake'), (56, 'a photo of a chair'), (57, 'a photo of a couch'),
                       (58, 'a photo of a potted plant'), (59, 'a photo of a bed'), (60, 'a photo of a dining table'),
                       (61, 'a photo of a toilet'), (62, 'a photo of a tv'), (63, 'a photo of a laptop'),
                       (64, 'a photo of a mouse'), (65, 'a photo of a remote'), (66, 'a photo of a keyboard'),
                       (67, 'a photo of a cell phone'), (68, 'a photo of a microwave'), (69, 'a photo of an oven'),
                       (70, 'a photo of a toaster'), (71, 'a photo of a sink'), (72, 'a photo of a refrigerator'),
                       (73, 'a photo of a book'), (74, 'a photo of a clock'), (75, 'a photo of a vase'),
                       (76, 'a photo of a scissors'), (77, 'a photo of a teddy bear'), (78, 'a photo of a hair drier'),
                       (79, 'a photo of a toothbrush'), (80, 'a photo of nothing')]

hico_unseen_index = {
    "default": [],
    # start from 0
    "rare_first": [509, 279, 280, 402, 504, 286, 499, 498, 289, 485, 303, 311, 325, 439, 351, 358, 66, 427, 379, 418,
                   70, 416,
                   389, 90, 395, 76, 397, 84, 135, 262, 401, 592, 560, 586, 548, 593, 526, 181, 257, 539, 535, 260, 596,
                   345, 189,
                   205, 206, 429, 179, 350, 405, 522, 449, 261, 255, 546, 547, 44, 22, 334, 599, 239, 315, 317, 229,
                   158, 195,
                   238, 364, 222, 281, 149, 399, 83, 127, 254, 398, 403, 555, 552, 520, 531, 440, 436, 482, 274, 8, 188,
                   216, 597,
                   77, 407, 556, 469, 474, 107, 390, 410, 27, 381, 463, 99, 184, 100, 292, 517, 80, 333, 62, 354, 104,
                   55, 50,
                   198, 168, 391, 192, 595, 136, 581],  # 120
    "non_rare_first": [38, 41, 20, 18, 245, 11, 19, 154, 459, 42, 155, 139, 60, 461, 577, 153, 582, 89, 141, 576, 75,
                       212, 472, 61,
                       457, 146, 208, 94, 471, 131, 248, 544, 515, 566, 370, 481, 226, 250, 470, 323, 169, 480, 479,
                       230, 385, 73,
                       159, 190, 377, 176, 249, 371, 284, 48, 583, 53, 162, 140, 185, 106, 294, 56, 320, 152, 374, 338,
                       29, 594, 346,
                       456, 589, 45, 23, 67, 478, 223, 493, 228, 240, 215, 91, 115, 337, 559, 7, 218, 518, 297, 191,
                       266, 304, 6, 572,
                       529, 312, 9, 308, 417, 197, 193, 163, 455, 25, 54, 575, 446, 387, 483, 534, 340, 508, 110, 329,
                       246, 173, 506,
                       383, 93, 516, 64],  # 120
    "unseen_object": [111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
                      126, 127, 128, 224, 225, 226, 227, 228, 229, 230, 231, 290, 291, 292, 293,
                      294, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 336, 337,
                      338, 339, 340, 341, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428,
                      429, 430, 431, 432, 433, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462,
                      463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 533, 534, 535, 536,
                      537, 558, 559, 560, 561, 595, 596, 597, 598, 599],  # 100
    "unseen_verb": [4, 6, 12, 15, 18, 25, 34, 38, 40, 49, 58, 60, 68, 69, 72, 73, 77, 82, 96, 97, 104, 113, 116, 118,
                    122, 129, 139, 147,
                    150, 153, 165, 166, 172, 175, 176, 181, 190, 202, 210, 212, 219, 227, 228, 233, 235, 243, 298, 313,
                    315, 320, 326, 336,
                    342, 345, 354, 372, 401, 404, 409, 431, 436, 459, 466, 470, 472, 479, 481, 488, 491, 494, 498, 504,
                    519, 523, 535, 536,
                    541, 544, 562, 565, 569, 572, 591, 595]
    # 84, 20 unseen verbs: [41, 100, 99, 91, 34, 42, 97, 84, 26, 106, 38, 56, 92, 79, 19, 76, 80, 2, 114, 62]
}
